home *** CD-ROM | disk | FTP | other *** search
/ Programmer Plus 2007 / Programmer-Plus-2007.iso / Programming / JAVA Utilities / JProxy 1.1.0 / EPORTAL / OEM_BUY.JSP < prev    next >
Encoding:
Text File  |  2003-04-29  |  7.2 KB  |  221 lines

  1. <%@ page language="java" import="
  2.     com.jproxy.site.mbeans.JMXInvocator,
  3.     com.jproxy.site.mbeans.config.*,
  4.     com.jproxy.site.*"
  5. %>
  6.  
  7. <jsp:useBean id="ses" scope="session" class="com.jproxy.site.JSPSession"/>
  8. <%
  9. ses.request(pageContext);
  10. ses.setNewHit(pageContext, "hits", "Buy JProxy Tunnel", null);
  11.  
  12. //String host = "http://jproxy.com";
  13. String host = "http://"+request.getServerName()+":"+request.getServerPort();
  14.  
  15. boolean isDisabled = false;
  16. int    arrModels[] = {0};
  17. int    arrModelPrices[][] = {{499, 99}};
  18.  
  19. int nCurPriceModel = arrModels[0];
  20. int firstLicensePrice = arrModelPrices[nCurPriceModel][0];
  21. int additionalLicensePrice = arrModelPrices[nCurPriceModel][1];
  22.  
  23. //int firstLicensePrice = 1;
  24. //int additionalLicensePrice = 1;
  25.  
  26. int amount = arrModelPrices[0][0];
  27. int licenses = 1;
  28. int customerId = 0;
  29. int invoice = 0;
  30.  
  31. // find out the number of licenses requested
  32. if(request.getParameter("licenses")!=null)
  33. {
  34.     try{
  35.       licenses = new Integer(request.getParameter("licenses")).intValue();
  36.           if (licenses <= 0)
  37.             licenses = 1;
  38.     }
  39.     catch(Exception ee){}
  40. }
  41.  
  42. // calculate the total amount based on the number of licenses and the pricing model
  43. if (request.getParameter("price_model") != null)
  44. {
  45.   nCurPriceModel = new Integer(request.getParameter("price_model")).intValue();
  46.  
  47.   for (int i=0; i< arrModels.length; i++) {
  48.     if (nCurPriceModel == arrModels[i]) {
  49.       amount = arrModelPrices[i][0] + arrModelPrices[i][1] * (licenses - 1);
  50.       break;
  51.     }
  52.   }
  53. }
  54.  
  55. //amount = firstLicensePrice+additionalLicensePrice*(licenses-1);
  56.  
  57. if(request.getParameter("submit_recalculate")!=null)
  58. {
  59. }
  60. if(request.getParameter("submit_purchase")!=null && request.getParameter("error")==null)
  61. {
  62. %>
  63.     <jsp:forward page="../purchase.jsp"/>
  64. <%
  65. }
  66. %>
  67.  
  68. <!-- HEADER -->
  69. <jsp:include page="../header.jsp" flush="true">
  70.   <jsp:param name="name" value="Buy JProxy Tunnel"/>
  71. </jsp:include>
  72.  
  73. <!-- MAIN PANEL -->
  74.  
  75. <%
  76.     if(isDisabled)
  77.     {
  78. %>
  79.             <blockquote>
  80.               <p><b>Sorry, </b></p>
  81.               <p><b>The page is under construction.</b></p>
  82.               <p><b>E-Commerce is coming soon.</b></p>
  83.               <p><b>Get free feature limited JProxy release <a href="download.html">here</a>.</b></p>
  84.             </blockquote>
  85. <%
  86.     }
  87.     else
  88.     {
  89.  
  90.         ConfigMBean mbean = (ConfigMBean)JMXInvocator.getMBean(
  91.             "JProxy:service=JProxyConfigMBean", ConfigMBean.class);
  92.         String productName = mbean.get("com.jproxy.proxy.name") + " " + mbean.get("com.jproxy.proxy.version");
  93.         String invoiceStr = mbean.get("com.jproxy.commerce.invoice");
  94.         try{
  95.             invoice = Integer.parseInt(invoiceStr);
  96.         }
  97.         catch(Exception e){
  98.             invoice = 15;
  99.         }
  100. %>
  101. <br>
  102.   <table class="h9Verdana" cellpadding="5" width="600" border="0">
  103. <!-- Prolog -->
  104.     <tr>
  105.      <td>
  106.         <table class="h9Verdana" border="0" bgcolor="9c9cff" cellpadding="1" cellspacing="0">
  107.          <tr><td>
  108.            <%=productName%>
  109.          </td></tr>
  110.          <tr><td>
  111.              <table class="h9Verdana" border="0" bgcolor="white" cellpadding="5" cellspacing="1" >
  112.               <tr>
  113.                <td class="h8Verdana" align="left">
  114.                  Please enter the number of host licenses you would like to purshase and click <b>Recalcualte</b> to get the updated price
  115.                </td>
  116.               </tr>
  117.               <tr>
  118.                <td align="left">
  119.                 <form method="get" action="buy.jsp">
  120.                   Quantity:
  121.                   <input type="input" name="licenses" value="<%=licenses%>" size="3">
  122.                                   # of concurrent clients:
  123.                                   <%
  124.                    ses.combobox_beans = JSPRes.dct.price_model;
  125.                                   %>
  126.                   <jsp:include page="combobox.jsp" flush="true">
  127.                     <jsp:param name="name" value="price_model"/>
  128.                     <jsp:param name="id" value="<%=nCurPriceModel%>"/>
  129.                   </jsp:include>
  130.                                   Total: <input type="text" name="total" READONLY value="$<%=amount%>" size="6">
  131.                      <INPUT TYPE=SUBMIT NAME=submit_recalculate WIDTH="20" VALUE="Recalculate">
  132.                 </form>
  133.                </td>
  134.               </tr>
  135.             </table>
  136.   <!-- begin separator -->
  137.           </td></tr>
  138.           <tr><td>
  139.   <!-- end separator -->
  140.            <table class="h8Verdana" width="100%" border="0" bgcolor="white" cellpadding="5" cellspacing="0" >
  141.             <tr>
  142.              <td align="left">
  143.                When you're ready to proceed to a secure payment form
  144.                please press the <b>Purshase</b> button
  145.              </td>
  146.              <td align="right">
  147.                <br>
  148.     <%
  149.     String headerHTML = "<font size=30 color=#6331CE>JProxy</font>";
  150.         headerHTML += "<font size=10 color=#9C00FF>.com</font>";
  151.     String footerHTML = "<font size=2><em>Copyright 2001-2002, JProxy</em></font>";
  152.     %>
  153.                <FORM METHOD=POST ACTION="https://secure.authorize.net/gateway/transact.dll">
  154.           <INPUT TYPE=HIDDEN NAME="x_amount" VALUE="<%=amount%>">
  155.           <INPUT TYPE=HIDDEN NAME="number_of_licenses" VALUE="<%=licenses%>">
  156.           <INPUT TYPE=HIDDEN NAME="x_Version" VALUE="3.0">
  157.           <INPUT TYPE=HIDDEN NAME="x_Login" VALUE="jproxyllc">
  158.           <INPUT TYPE=HIDDEN NAME="x_Show_Form" VALUE="PAYMENT_FORM">
  159.           <INPUT TYPE=HIDDEN NAME="x_Cust_ID" VALUE="<%=customerId%>">
  160.           <INPUT TYPE=HIDDEN NAME="x_Invoice_Num" VALUE="<%=invoice%>">
  161.           <INPUT TYPE=HIDDEN NAME="x_Description" VALUE="<%=productName%>">
  162.           <!-- INPUT TYPE=HIDDEN NAME="x_Logo_URL" VALUE="http://jproxy.com/main/resources/jproxy.gif" -->
  163.           <INPUT TYPE=HIDDEN NAME="x_Header_HTML_Payment_Form" VALUE="<%=headerHTML%>">
  164.           <INPUT TYPE=HIDDEN NAME="x_Footer_HTML_Payment_Form" VALUE="<%=footerHTML%>">
  165.           <INPUT TYPE=HIDDEN NAME="x_Receipt_Link_Method" VALUE="GET">
  166.           <INPUT TYPE=HIDDEN NAME="x_Receipt_Link_Text" VALUE="Click here to continue">
  167.           <INPUT TYPE=HIDDEN NAME="x_Receipt_Link_URL" VALUE="<%=host%>/main/purchase.jsp;jsessionid=<%=request.getSession().getId()%>">
  168.           <INPUT TYPE=SUBMIT NAME=submit_purchase WIDTH="20" VALUE="Purshase">
  169.                </FORM>
  170.              </td>
  171.             </tr>
  172.            </table>
  173.          </td></tr>
  174.         </table>
  175.      </td>
  176.     </tr>
  177.  
  178.     <tr>
  179.      <td>
  180.           <table class="h9Verdana" border="0" bgcolor="9c9cff" cellpadding="1" cellspacing="0">
  181.            <tr><td>
  182.              JProxy Software Refund Policy
  183.            </td></tr>
  184.            <tr><td>
  185.              <table width="100%" class="h9Verdana" border="0" bgcolor="white" cellpadding="5" cellspacing="1" >
  186.                 <tr>
  187.                  <td class="h9Verdana" align="left">
  188.                   <br>
  189.                   <b>J</b>Proxy software is priced for electronic delivery only. Customers
  190.                                     must download the files. We do not ship CDs or Disks. Therefore,
  191.                                     JProxy does not issue refunds for any reason. Customers are responsible
  192.                                     for downloading and trying the feature-limited version of the
  193.                                     product and sample code to ensure that the software will work
  194.                                     on the customers system and that the customer already has the
  195.                                     necessary hardware and application required to run the software.
  196.                                     <br>
  197.                                     When JProxy receives payment, we send customers a password to
  198.                                     download the full versions of our software. This password carries
  199.                                     a lifetime registration. That allows our customers to revisit
  200.                                     and download the latest versions free for LIFE! The high quality,
  201.                                     delivery method and low cost of our software amply justify our
  202.                                     'no refund' policy.
  203.                                     <br>
  204.                                     <br>
  205.                  </td>
  206.                 </tr>
  207.               </table>
  208.             </td></tr>
  209.           </table>
  210.           <p>
  211.      </td>
  212.     </tr>
  213.   </table>
  214. <%
  215.     }
  216. %>
  217.  
  218. <!-- FOOTER -->
  219. <jsp:include page="../footer.jsp" flush="true"/>
  220.  
  221.